Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Consolidate editor filters and actions #42356

Merged
merged 3 commits into from
Jul 18, 2022

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Jul 12, 2022

What?

Follow-up for #42024.

The new documentation page is disconnected from the Block Editor Handbook. I will take care of changes to the Reference Guides separately as it requires some discussion how to rephrase all sections for filters to cover also actions similar to what you can see in WordPress core.

All sections covering WordPress hooks in Block Editor Handbook are wrongly referencing filters. It should be "hooks" as we use both filters and actions.

Why?

This is also how documentation is structured for WordPress core. See https://developer.wordpress.org/plugins/hooks/.

How?

This PR tries to address the issue partially by renaming those documents that cover both filters and action. I didn't change URLs because it would require some bigger changes like updating all references to those pages and adding HTTP redirects so all external URLs continue to work.

Finally, I moved the section about Error Boundaries from the editor actions document that was disconnected from Block Editor Handbook to the one that previously covered only editor filters.

@gziolo gziolo added the [Type] Developer Documentation Documentation for developers label Jul 12, 2022
@gziolo gziolo self-assigned this Jul 12, 2022
@gziolo gziolo requested review from fullofcaffeine and bph July 12, 2022 09:23
@gziolo gziolo added the [Feature] Extensibility The ability to extend blocks or the editing experience label Jul 12, 2022
@aristath
Copy link
Member

aristath commented Jul 12, 2022

I love the idea of having them in the same doc as hooks... That's how we search for them so it's what I'd expect to see.
I see this is a draft PR, but the changes make sense and everything is in its right place so I went ahead and pre-approved the PR 👍

@gziolo gziolo marked this pull request as ready for review July 12, 2022 09:29
@gziolo
Copy link
Member Author

gziolo commented Jul 12, 2022

I see this is a draft PR, but the changes make sense and everything is in its right place so I want ahead and pre-approved the PR 👍

It was only a draft because I was still compiling the description 😄

### Block Directory
## Logging errors

A JavaScript error in a part of the UI shouldn’t break the whole app. To solve this problem for users, React library uses a concept of an [“error boundary”](https://reactjs.org/docs/error-boundaries.html). Error boundaries are React components that catch JavaScript errors anywhere in their child component tree, and display a fallback UI instead of the component tree that crashed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The brief background about Error Boundaries in React really helps give some useful context before hoping into the hook! 👍🏻

@gziolo gziolo merged commit f233a32 into trunk Jul 18, 2022
@gziolo gziolo deleted the update/error-boundary-docs branch July 18, 2022 09:29
@github-actions github-actions bot added this to the Gutenberg 13.8 milestone Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants